package com.example.finalproject.User;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserRepository userRepository;
    //调用UserRepository接口的数据库命令添加新用户
    public void insertUser(User user) {
        userRepository.insertUser(user);
    }
    //根据userName查找用户
    public User selectUserByName(String userName) {
        return userRepository.selectUserByName(userName);
    }
}
